package parser;

public class ChatMessage
{
	private String type;
	private String from;
	private String to;
	private long timestamp;
	private String text;
	
	public ChatMessage(String type, String from, String to, long timestamp, String text)
	{
		this.type = type;
		this.from = from;
		this.to = to;
		this.timestamp = System.currentTimeMillis();
		this.text = text;
	}
	
	public ChatMessage(String type, String from, String to, String timestamp, String text)
	{
		this.type = type;
		this.from = from;
		this.to = to;
		this.timestamp = System.currentTimeMillis();
		this.text = text;
	}

	public void setType(String type) {this.type = type;}
	public void setFrom(String from) {this.from = from;}
	public void setTo(String to) {this.to = to;}
	public void setTimestamp() {this.timestamp = System.currentTimeMillis(); }
	public void setText(String text) {this.text = text;}
	
	public String getType() {return type;}
	public String getFrom() {return from;}
	public String getTo() {return to;}
	public long getTimestamp() {return timestamp;}
	public String getText() {return text;}
	
	public void printMessage()
	{
		System.out.println("Message (from: " + from + ") (to: " + to + ")");
		System.out.println("Sent at: " + timestamp);
		System.out.println("Text: " + text);
		System.out.println();
	}
}
